<?php
/**
 * Created by PhpStorm.
 * User: liuxiaojie
 * Date: 2019-03-10
 * Time: 22:51
 */

namespace app\ops\controller;

class Order extends Base

{

    function index()
    {
        $list = db('order')->alias('o')
            ->join('customer c', 'o.customer_id = c.id')
            ->where(['o.status'=> ['>', 10]])
            ->field('o.*, c.nickname')
            ->order('o.id desc')
            ->paginate(10);

        $this->assign('list', $list);
        return $this->fetch();
    }

    function delete()
    {
        $id = request()->post('id');
        db('prize')->where(['id'=> $id])->delete();
        return success([]);
    }
}